package org.erp.product.infrastructure.convert;

import org.erp.product.domain.bo.ProductInfoQueryBo;
import org.erp.product.domain.dto.ProductInfoQueryDto;
import org.erp.product.domain.entity.ConnectLog;
import org.erp.product.domain.entity.ProductInfo;
import org.erp.product.domain.vo.ProductInfoVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * 产品实体转换
 *
 * @author libin
 * @version 1.0
 * @description: 产品实体转换
 * @date 2025/11/14 13:05
 **/
@Mapper(componentModel = "spring")
public interface ProductInfoConvert {

    @Mappings(value = {
            @Mapping(target = "id", ignore = true),
            @Mapping(target = "operationId", source = "transferId"),
            @Mapping(target = "operationName", source = "transferName"),
            @Mapping(target = "inspectionStatus", constant = "0"),
            @Mapping(target = "createTime", ignore = true),
            @Mapping(target = "createBy", ignore = true),
            @Mapping(target = "updateTime", ignore = true),
            @Mapping(target = "updateBy", ignore = true)
    })
    ProductInfo convert(ConnectLog connectLog);

    @Mappings(value = {})
    ProductInfoQueryDto boConvertDto(ProductInfoQueryBo productInfoQueryBo);

    @Mappings(value = {})
    ProductInfoVo convertVo(ProductInfo productInfo);
}
